package com.chencq.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.chencq.annotation.WebServlet;

@WebServlet("/user")
public class UserServlet {

	public Logger  LOGGER=LoggerFactory.getLogger(UserServlet.class);
    /**
	 * servlet使用默认的doPost，doGet方法处理请求
	 * 
	 * 
	 * 访问的地址
	 * http://localhost:8080/mvc/user.do
	 */
	public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		 LOGGER.info("/进入UserServlet--->"+request.getMethod());
		response.sendRedirect(request.getContextPath()+"/view/test.jsp");
	}
	
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}
}
